package com.genersoft.iot.vmp.rabbitmq.consumer;

import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceMsg;
import com.genersoft.iot.vmp.rabbitmq.config.ExchangeName;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author WangPing
 * @Date 2024/10/23
 **/

@Component
public class RabbitmqConsumer {

    @RabbitListener(bindings = @QueueBinding(
            exchange = @Exchange(value = ExchangeName.deviceUploadDataExchange,type = "topic"),
            value = @Queue(value = "test", durable = "true"),
            key = "upload.*"
    ), ackMode = "AUTO", concurrency = "1-10")
    public void testData(DeviceMsg testData) {
        System.out.println("testData: " + testData.toString());
    }

}